"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.天谕Handler = void 0;
const Config_1 = require("../../Config");
const Big_1 = require("../core/Big");
const GameUtils_1 = __importDefault(require("../GameUtils"));
const BaseHandler_1 = require("./BaseHandler");
const GameUtils_2 = __importDefault(require("../GameUtils"));
class 天谕Handler extends BaseHandler_1.BaseHandler {
    天谕_明魂搜根(data, player) {
        this.handlerMgr.spendAction(player, Config_1.Config.COST_天谕_明魂搜根);
        let startPoint = this.gameMgr.map_point.get(data.start);
        let endPoint = this.gameMgr.map_point.get(data.end);
        let big_start = startPoint.big;
        big_start.actionOnce();
        let big_end = endPoint.big;
        if (big_end == null) {
            this.handlerMgr.showToast(player, "明魂失败，这里没有大子");
            return;
        }
        big_start.smell(big_end.player);
        this.gameMgr.sendBroadcast(GameUtils_2.default.getObj("play_sound", { "sound": "天谕_眨眼", "username": player.username }));
    }
    天谕_天眼传真(data, player) {
        this.handlerMgr.spendAction(player, Config_1.Config.COST_天谕_天眼传真);
        let startPoint = this.gameMgr.map_point.get(data.start);
        let big_start = startPoint.big;
        big_start.look();
        this.gameMgr.sendBroadcast(GameUtils_2.default.getObj("play_sound", { "sound": "天谕_眨眼", "username": player.username }));
    }
    /** 直接从小子行动抄过来 */
    天谕_神兵天降(data, player) {
        //行动力消耗
        this.handlerMgr.spendAction(player, Config_1.Config.COST_天谕_神兵天降);
        //出大
        let startPoint = this.gameMgr.map_point.get(data.start);
        let endPoint = this.gameMgr.map_point.get(data.end);
        let big_start = startPoint.big;
        big_start.actionOnce();
        let oldBig = endPoint.big;
        if (oldBig != null) {
            this.handlerMgr.showToast(player, "出大失败");
            oldBig.deleteState(Big_1.BigState.HIDE);
            this.gameMgr.sendBroadcast(GameUtils_1.default.getObj("play_effect", { "effect": "big_die", "point_id": endPoint.id, "username": player.username }));
            return;
        }
        let big = new Big_1.Big();
        big.init(this.gameMgr, big_start.player, endPoint, big_start.mother, null);
        this.gameMgr.sendBroadcast(GameUtils_1.default.getObj("born_big", { "big": big.toObj() }));
    }
}
exports.天谕Handler = 天谕Handler;
